package com.commpany.jdq.core.constant;

/**
 * 设备类型枚举
 *
 * Created by an on 15/12/23.
 */
public enum DeviceTypeEnum {

    IOS, Android, H5;

    public static DeviceTypeEnum transIgnorCase(String deviceType) {
        if (null == deviceType || deviceType.trim().isEmpty()) {
            return null;
        }

        String lowerStr = deviceType.trim().toLowerCase();
        DeviceTypeEnum[] values = DeviceTypeEnum.values();
        for (DeviceTypeEnum value : values) {
            if (value.toString().toLowerCase().equals(lowerStr)) {
                return value;
            }
        }
        return null;
    }

}
